<?php
require_once '../lib/controller.php';

class action extends controller
{
	function do_get()
	{
		$db = $this->module('lib.db');
		$site = $this->module('biz.site');
		$site->delete_site( array('user_id'=>$this->session['user_id'],'id'=>$this->get['id']) );

		$this->msg('删除成功', 3, $this->server['HTTP_REFERER']);
	}

	function check_privileges()
	{
		if( ! isset($this->session['user_id']) )
		{
			$this->msg('请先登录', 3, 'login.php');
			return false;
		}
		else
		{
			return true;
		}
	}

	public function check_get()
	{
		if( ! is_numeric($this->get['id']) || ! preg_match("/[0-9]{1,}/", $this->get['id']) )
		{
			$this->msg('参数错误');
			return false;
		}
		return true;
	}
}

$action = new action();
$action->run();
?>